package net.sureon.web.user;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sureon.app.UserSession;
import net.sureon.biz.DailyTimingMgr;
import net.sureon.dao.DailyTimingStatistic;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

/**
 * 
 * @author Administrator
 * 
 */
public class MyDailyTimingStatistic implements Controller {

	private DailyTimingMgr dailyTimingMgr;

	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {

		long userID = ((net.sureon.app.UserSession) request.getSession()
				.getAttribute(UserSession.HTTP_SESSION_KEY)).getUserID();

		long companyID = ((net.sureon.app.UserSession) request.getSession()
				.getAttribute(UserSession.HTTP_SESSION_KEY)).getCompanyID();

		List<DailyTimingStatistic> all = null;
		all = dailyTimingMgr.getDailyTimingStatisticInfo(companyID,userID);

		request.setAttribute("all", all);
		
		return new ModelAndView("user/myDailyTimingStatistic");
	}

	public DailyTimingMgr getDailyTimingMgr() {
		return dailyTimingMgr;
	}

	public void setDailyTimingMgr(DailyTimingMgr dailyTimingMgr) {
		this.dailyTimingMgr = dailyTimingMgr;
	}
}
